<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@include file="/WEB-INF/commit/head.jsp" %>

<div class="layui-body">
	<div style="padding: 15px;" value="${userSession.roleid }" id="gbook">留言管理</div>
	<div class="layui-btn-group rolemanager" style="display:none" id="tou">
		<button class="layui-btn" data-type ="select">查看</button>
		<button class="layui-btn" data-type ="update">回复</button>
		<button class="layui-btn" data-type ="del" id="del">删除</button>
	</div>
	<div >
	<table class="layui-table" id="gbookTable">
	</table>
	</div>
	<div style="display:none" id="huiyuan">
	<p>我的留言：</p>
	<div id= "liu">
	</div>
		<div style="display:none" id="liuyan">
		<p >我要留言</p>
			<form action="gbook/add.html" method="post" enctype="multipart/form-data">
				<div class="layui-form-item layui-form-text">
	    		<label class="layui-form-label">留言内容</label>
	    		<div class="layui-input-block">
	     		 <textarea placeholder="请输入内容" class="layui-textarea" name="gbookcontent"></textarea>
			   	 </div>
			 	 </div>
			  <div class="layui-form-item">
				<label id="yzmcode" class="layui-form-label"
					style="color: #00000; font-weight: 600;">验证码:</label>
				<div class="layui-input-block">
					<input type="text" name="code" id="code" required
						lay-verify="required" placeholder="请输入验证码" autocomplete="off"
						class="layui-input">
				</div>
				<div style="margin-left:110px;margin-top:20px">
						<div class="col-sm-4" >
							<img id="codeImg" src="yzm" class="img-responsive"
								style="display: block;width:100px;height: 40px">
						</div>
						<a id="change" style="color: #000000; font-weight: 600;">看不清楚换一张</a>
				</div>
				</div>
				  <div class="layui-form-item">
				    <div class="layui-input-block">
				      <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
				    </div>
				  </div>
			</form>
		</div>
	</div>
</div>
<div>
<form class="layui-form" id="fm_update" style="display:none" lay-filter="gbookUpdate" action="gbook/update.html" method="post" enctype="multipart/form-data">
 <input type="hidden" name="id" id="id"> 
  <div class="layui-form-item">
    <label class="layui-form-label">留言人</label>
    <div class="layui-input-block">
      <input type="text" name="gbookuser" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">留言内容</label>
    <div class="layui-input-block">
      <textarea placeholder="请输入内容" class="layui-textarea" name="gbookcontent"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">留言时间</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" id="time2" name="gbooktime" class="layui-input">
      </div>
    </div>
  </div>
  <hr>
    <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">回复</label>
    <div class="layui-input-block">
      <textarea placeholder="请输入内容" class="layui-textarea" name="replycontent"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
 </form>
</div>
<div>
<form class="layui-form" id="fm_select" style="display:none" lay-filter="gbookselect"  method="post" enctype="multipart/form-data">
 <input type="hidden" name="id" id="id"> 
  <div class="layui-form-item">
    <label class="layui-form-label">留言人</label>
    <div class="layui-input-block">
      <input type="text" name="gbookuser" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">留言内容</label>
    <div class="layui-input-block">
      <textarea placeholder="请输入内容" class="layui-textarea" name="gbookcontent"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">留言时间</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" id="time2" name="gbooktime" class="layui-input">
      </div>
    </div>
  </div>
  <hr>
    <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">回复</label>
    <div class="layui-input-block">
      <textarea placeholder="请输入内容" class="layui-textarea" name="replycontent"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">回复时间</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" id="time2" name="replytime" class="layui-input">
      </div>
    </div>
  </div>
 </form>
</div>

<script  type="text/html" id="isReplyTpl">
  <div class="layui-form-item">
	{{#  if(d.isreply == 0){ }}
      <input type="checkbox" name="like[0]" title="未回复" >
 	{{#  } else { }}
      <input type="checkbox" name="like[1]" title="已回复" checked>
   {{#  } }}
  </div>
</script>
<script src="./layer/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/gbooklist.js"></script>
<%@include file="/WEB-INF/commit/dibu.jsp" %>